package com.gouqi.tools.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gouqi.tools.model.dto.tool.ToolQueryRequest;
import com.gouqi.gouqitoolscommon.model.entity.Tool;
import com.gouqi.tools.model.vo.ToolVO;

import javax.servlet.http.HttpServletRequest;

/**
 * @description 针对表【tool(工具信息)】的数据库操作Service
 */
public interface ToolService extends IService<Tool> {

    /**
     * 校验
     *
     * @param tool
     * @param add
     */
    void validTool(Tool tool, boolean add);

    /**
     * 获取查询条件
     *
     * @param toolQueryRequest
     * @return
     */
    QueryWrapper<Tool> getQueryWrapper(ToolQueryRequest toolQueryRequest);

    /**
     * 获取工具封装
     *
     * @param tool
     * @param request
     * @return
     */
    ToolVO getToolVO(Tool tool, HttpServletRequest request);

    /**
     * 分页获取工具封装
     *
     * @param toolPage
     * @param request
     * @return
     */
    Page<ToolVO> getToolVOPage(Page<Tool> toolPage, HttpServletRequest request);


}
